<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="error.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../js/themes/base/jquery.ui.all.css">
<script src="../js/jquery-1.5.1.js"></script>
<script src="../js/ui/jquery.ui.core.js"></script>
<script src="../js/ui/jquery.ui.widget.js"></script>
<script src="../js/ui/jquery.ui.datepicker.js"></script>
<script src="../js/ui/jquery.ui.tabs.js"></script>
<script>
	$(function() {
		$( "#datepicker" ).datepicker();
	});
</script>
<script>
	$(function() {
		$( "#tabs" ).tabs({
			collapsible: true
		});
	});
</script>
</head>
<body background="../image/9d3c9c2082a1edaf08d876e.jpg">
<%
        request.setCharacterEncoding("utf-8");
		String name = request.getParameter("name");
		String pass = request.getParameter("pass");
%>
<%--<jsp:forward page="add.jsp">
    <jsp:param name="name" value="<%=name%>"></jsp:param>
	<jsp:param name="pass" value="<%=pass%>"></jsp:param>
</jsp:forward>--%>
<form name="info" id="info" action="add.jsp" method="post">
  <div id="base_info" style="width:400px;position:absolute; left:500px;">
    <table>
      <tr>
        <td>恭喜注册成功，账户名是：<font color="#FF0000"><%=name%></font>,密码是：<font color="#FF0000"><%=pass%></font>，谨记！</td>
      </tr>
	</table>
	<table>
      <tr>
        <td>QQ：</td>
        <td><input name="qq" id="qq" isRequired="true" validChar="\d{8,10}" type="text" /></td>
      </tr>
      <tr>
        <td>TEL:</td>
        <td><input name="tel" id="tel" isRequired="true" validChar="\d{11}" type="text" /></td>
      </tr>
      <tr>
        <td>E-mail:</td>
        <td><input type="text" name="mail" id="mail" validChar="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" isRequired="true" /></td>
      </tr>
      <tr>
        <td>Local:</td>
        <td><input type="text" name="local" id="local" isRequired="false" /></td>
      </tr>
      <tr>
        <td>性别</td>
        <td><input type="radio" name="sex" id="sex" value="boy" />
          男
          <input type="radio" name="sex" id="sex" value="girl" />
          女</td>
      </tr>
      <tr>
        <td>生日</td>
        <td><input type="text" id="datepicker" name="birth" isRequired="false" value="1/1/1990" /></td>
      </tr>
      <tr>
        <td><input type="button" onclick="check(document.info);" value="提交" /></td>
        <td></td>
      </tr>
	  <tr>
	     <td><input type="hidden" name="name" value="<%=name%>" /><input type="hidden" name="pass" value="<%=pass%>" />
		 </td>
	  </tr>
    </table>
  </div>
  <div class="demo">
    <div id="tabs" style="width:400px;position:absolute; left:500px; top:250px">
	<!--看着写位置-->
      <ul>
        <li><a href="#tags1">详细信息</a></li>
      </ul>
      <div id="tags1">
        <table>
          <tr>
            <td>父亲</td><td><input type="text" name="pa" isRequired="false" /></td>
          </tr>
          <tr>
            <td>母亲</td><td><input type="text" name="ma" isRequired="false" /></td>
          </tr>
          <tr>
            <td>喜欢的食物</td><td><input type="text" name="food" isRequired="false" /></td>
          </tr>
          <tr>
            <td>小学</td><td><input name="pri" type="text" isRequired="false" /></td>
          </tr>
          <tr>
            <td>初中</td><td><input type="text" name="mid" isRequired="false" /></td>
          </tr>
          <tr>
            <td>高中</td><td><input type="text" name="hig" isRequired="false" /></td>
          </tr>
        </table>
      </div>
    </div>
  </div>
</form>
</body>
</html>
<script language="JavaScript">
<!--
function check(vform)
{
      for(var i=0;i<vform.elements.length;i++)
     {
          if(vform.elements[i].type=="text")
          {
            	var checkResult=checkTextBox(vform.elements[i]);
	            var name=vform.elements[i].getAttribute("name");
                if(checkResult)
	            {
                      continue;
                }
                else
	            {
	                  alert(name+"格式不对、但是它可以为空");
	                  vform.elements[i].focus();
					  return;
                }
          }
    }
	vform.submit();
}
function checkTextBox(vTextBox)
{
         var validChar=vTextBox.getAttribute("validChar");
         var isRequired=vTextBox.getAttribute("isRequired");
         var inputValue=vTextBox.value;
		 if(isRequired!="true")
		 {
		       return true;
		 }
		 else
		 {
               if(inputValue.length<1)
			   {
			         return true;
			   }
			   else
			   {
			         var regexStr="^"+validChar+"$";
                     var regex=new RegExp(regexStr);
                     return regex.test(inputValue);
			   }
		 }
}
-->
</script>
